//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension Synthetics {
    // MARK: Enums

    public enum BrowserType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case chrome = "CHROME"
        case firefox = "FIREFOX"
        public var description: String { return self.rawValue }
    }

    public enum CanaryRunState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "FAILED"
        case passed = "PASSED"
        case running = "RUNNING"
        public var description: String { return self.rawValue }
    }

    public enum CanaryRunStateReasonCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case canaryFailure = "CANARY_FAILURE"
        case executionFailure = "EXECUTION_FAILURE"
        public var description: String { return self.rawValue }
    }

    public enum CanaryRunTestResult: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "FAILED"
        case passed = "PASSED"
        case unknown = "UNKNOWN"
        public var description: String { return self.rawValue }
    }

    public enum CanaryState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case creating = "CREATING"
        case deleting = "DELETING"
        case error = "ERROR"
        case ready = "READY"
        case running = "RUNNING"
        case starting = "STARTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum CanaryStateReasonCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case createFailed = "CREATE_FAILED"
        case createInProgress = "CREATE_IN_PROGRESS"
        case createPending = "CREATE_PENDING"
        case deleteFailed = "DELETE_FAILED"
        case deleteInProgress = "DELETE_IN_PROGRESS"
        case invalidPermissions = "INVALID_PERMISSIONS"
        case rollbackComplete = "ROLLBACK_COMPLETE"
        case rollbackFailed = "ROLLBACK_FAILED"
        case syncDeleteInProgress = "SYNC_DELETE_IN_PROGRESS"
        case updateComplete = "UPDATE_COMPLETE"
        case updateInProgress = "UPDATE_IN_PROGRESS"
        case updatePending = "UPDATE_PENDING"
        public var description: String { return self.rawValue }
    }

    public enum DependencyType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case lambdaLayer = "LambdaLayer"
        public var description: String { return self.rawValue }
    }

    public enum EncryptionMode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case sseKms = "SSE_KMS"
        case sseS3 = "SSE_S3"
        public var description: String { return self.rawValue }
    }

    public enum ProvisionedResourceCleanupSetting: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case automatic = "AUTOMATIC"
        case off = "OFF"
        public var description: String { return self.rawValue }
    }

    public enum ResourceToTag: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case lambdaFunction = "lambda-function"
        public var description: String { return self.rawValue }
    }

    public enum RunType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case canaryRun = "CANARY_RUN"
        case dryRun = "DRY_RUN"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ArtifactConfigInput: AWSEncodableShape {
        /// A structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.  Artifact encryption functionality is available only for canaries that use Synthetics runtime version  syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary artifacts
        public let s3Encryption: S3EncryptionConfig?

        @inlinable
        public init(s3Encryption: S3EncryptionConfig? = nil) {
            self.s3Encryption = s3Encryption
        }

        public func validate(name: String) throws {
            try self.s3Encryption?.validate(name: "\(name).s3Encryption")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Encryption = "S3Encryption"
        }
    }

    public struct ArtifactConfigOutput: AWSDecodableShape {
        /// A structure that contains the configuration of encryption settings for canary artifacts that are stored in Amazon S3.
        public let s3Encryption: S3EncryptionConfig?

        @inlinable
        public init(s3Encryption: S3EncryptionConfig? = nil) {
            self.s3Encryption = s3Encryption
        }

        private enum CodingKeys: String, CodingKey {
            case s3Encryption = "S3Encryption"
        }
    }

    public struct AssociateResourceRequest: AWSEncodableShape {
        /// Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// The ARN of the canary that you want to associate with the specified group.
        public let resourceArn: String

        @inlinable
        public init(groupIdentifier: String, resourceArn: String) {
            self.groupIdentifier = groupIdentifier
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.groupIdentifier, key: "GroupIdentifier")
            try container.encode(self.resourceArn, forKey: .resourceArn)
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct AssociateResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct BaseScreenshot: AWSEncodableShape & AWSDecodableShape {
        /// Coordinates that define the part of a screen to ignore during screenshot comparisons. To obtain the  coordinates to use here, use the  CloudWatch console to draw the boundaries on the screen. For more information, see   Editing or deleting a canary
        public let ignoreCoordinates: [String]?
        /// The name of the screenshot. This is generated the first time the canary is run after the UpdateCanary operation that specified for this canary to perform visual monitoring.
        public let screenshotName: String

        @inlinable
        public init(ignoreCoordinates: [String]? = nil, screenshotName: String) {
            self.ignoreCoordinates = ignoreCoordinates
            self.screenshotName = screenshotName
        }

        public func validate(name: String) throws {
            try self.ignoreCoordinates?.forEach {
                try validate($0, name: "ignoreCoordinates[]", parent: name, pattern: "^(-?\\d{1,5}\\.?\\d{0,2},){3}(-?\\d{1,5}\\.?\\d{0,2}){1}$")
            }
            try self.validate(self.ignoreCoordinates, name: "ignoreCoordinates", parent: name, max: 20)
            try self.validate(self.screenshotName, name: "screenshotName", parent: name, max: 1024)
            try self.validate(self.screenshotName, name: "screenshotName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case ignoreCoordinates = "IgnoreCoordinates"
            case screenshotName = "ScreenshotName"
        }
    }

    public struct BrowserConfig: AWSEncodableShape & AWSDecodableShape {
        /// The browser type associated with this browser configuration.
        public let browserType: BrowserType?

        @inlinable
        public init(browserType: BrowserType? = nil) {
            self.browserType = browserType
        }

        private enum CodingKeys: String, CodingKey {
            case browserType = "BrowserType"
        }
    }

    public struct Canary: AWSDecodableShape {
        /// A structure that contains the configuration for canary artifacts, including  the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigOutput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. Artifacts include the log file, screenshots, and HAR files.
        public let artifactS3Location: String?
        /// A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.  If not specified, browserConfigs defaults to Chrome.
        public let browserConfigs: [BrowserConfig]?
        public let code: CanaryCodeOutput?
        /// Returns the dry run configurations for a canary.
        public let dryRunConfig: DryRunConfigOutput?
        /// The ARN of the Lambda function that is used as your canary's engine. For more information  about Lambda ARN format, see Resources and Conditions for Lambda Actions.
        public let engineArn: String?
        /// A list of engine configurations for the canary, one for each browser type that the canary is configured to run on. All runtime versions syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, use engineConfigs only.  You can no longer use engineArn in these versions. Runtime versions older than syn-nodejs-puppeteer-11.0 and syn-nodejs-playwright-3.0 continue to support engineArn to ensure backward compatibility.
        public let engineConfigs: [EngineConfig]?
        /// The ARN of the IAM role used to run the canary. This role must include lambda.amazonaws.com as a principal in the trust policy.
        public let executionRoleArn: String?
        /// The number of days to retain data about failed runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let failureRetentionPeriodInDays: Int?
        /// The unique ID of this canary.
        public let id: String?
        /// The name of the canary.
        public let name: String?
        /// Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If it is AUTOMATIC, the Lambda functions and layers will be deleted when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
        public let provisionedResourceCleanup: ProvisionedResourceCleanupSetting?
        public let runConfig: CanaryRunConfigOutput?
        /// Specifies the runtime version to use for the canary. For more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String?
        /// A structure that contains information about how often the canary is to run, and when these runs are to stop.
        public let schedule: CanaryScheduleOutput?
        /// A structure that contains information about the canary's status.
        public let status: CanaryStatus?
        /// The number of days to retain data about successful runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let successRetentionPeriodInDays: Int?
        /// The list of key-value pairs that are associated with the canary.
        public let tags: [String: String]?
        /// A structure that contains information about when the canary was created, modified, and most recently run.
        public let timeline: CanaryTimeline?
        /// If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison.
        public let visualReference: VisualReferenceOutput?
        /// A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.  syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported. Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility.
        public let visualReferences: [VisualReferenceOutput]?
        public let vpcConfig: VpcConfigOutput?

        @inlinable
        public init(artifactConfig: ArtifactConfigOutput? = nil, artifactS3Location: String? = nil, browserConfigs: [BrowserConfig]? = nil, code: CanaryCodeOutput? = nil, dryRunConfig: DryRunConfigOutput? = nil, engineArn: String? = nil, engineConfigs: [EngineConfig]? = nil, executionRoleArn: String? = nil, failureRetentionPeriodInDays: Int? = nil, id: String? = nil, name: String? = nil, provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil, runConfig: CanaryRunConfigOutput? = nil, runtimeVersion: String? = nil, schedule: CanaryScheduleOutput? = nil, status: CanaryStatus? = nil, successRetentionPeriodInDays: Int? = nil, tags: [String: String]? = nil, timeline: CanaryTimeline? = nil, visualReference: VisualReferenceOutput? = nil, visualReferences: [VisualReferenceOutput]? = nil, vpcConfig: VpcConfigOutput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.browserConfigs = browserConfigs
            self.code = code
            self.dryRunConfig = dryRunConfig
            self.engineArn = engineArn
            self.engineConfigs = engineConfigs
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.id = id
            self.name = name
            self.provisionedResourceCleanup = provisionedResourceCleanup
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.status = status
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.tags = tags
            self.timeline = timeline
            self.visualReference = visualReference
            self.visualReferences = visualReferences
            self.vpcConfig = vpcConfig
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case browserConfigs = "BrowserConfigs"
            case code = "Code"
            case dryRunConfig = "DryRunConfig"
            case engineArn = "EngineArn"
            case engineConfigs = "EngineConfigs"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case id = "Id"
            case name = "Name"
            case provisionedResourceCleanup = "ProvisionedResourceCleanup"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case status = "Status"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case tags = "Tags"
            case timeline = "Timeline"
            case visualReference = "VisualReference"
            case visualReferences = "VisualReferences"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CanaryCodeInput: AWSEncodableShape {
        ///  BlueprintTypes is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is multi-checks. Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify BlueprintTypes, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.  BlueprintTypes is supported only on canaries for syn-nodejs-3.0 runtime or later.
        public let blueprintTypes: [String]?
        /// A list of dependencies that should be used for running this canary. Specify the dependencies as a key-value pair, where the key is the type of dependency and the value is the dependency reference.
        public let dependencies: [Dependency]?
        /// The entry point to use for the source code when running the canary. For canaries that use the  syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer runtime earlier than syn-nodejs.puppeteer-3.4,  the handler must be specified as  fileName.handler. For  syn-python-selenium-1.1, syn-nodejs.puppeteer-3.4, and later runtimes, the handler can be specified as   fileName.functionName , or you can specify a folder where canary scripts reside as
        ///  folder/fileName.functionName . This field is required when you don't specify BlueprintTypes and is not allowed when you specify BlueprintTypes.
        public let handler: String?
        /// If your canary script is located in Amazon S3, specify the bucket name here. Do not include s3:// as the  start of the bucket name.
        public let s3Bucket: String?
        /// The Amazon S3 key of your script. For more information, see Working with Amazon S3 Objects.
        public let s3Key: String?
        /// The Amazon S3 version ID of your script.
        public let s3Version: String?
        /// If you input your canary script directly into the canary instead of referring to an Amazon S3 location, the value of this parameter is the base64-encoded contents of the .zip file that  contains the script. It must be smaller than 225 Kb. For large canary scripts, we recommend that you use an Amazon S3 location instead of inputting it  directly with this parameter.
        public let zipFile: AWSBase64Data?

        @inlinable
        public init(blueprintTypes: [String]? = nil, dependencies: [Dependency]? = nil, handler: String? = nil, s3Bucket: String? = nil, s3Key: String? = nil, s3Version: String? = nil, zipFile: AWSBase64Data? = nil) {
            self.blueprintTypes = blueprintTypes
            self.dependencies = dependencies
            self.handler = handler
            self.s3Bucket = s3Bucket
            self.s3Key = s3Key
            self.s3Version = s3Version
            self.zipFile = zipFile
        }

        public func validate(name: String) throws {
            try self.blueprintTypes?.forEach {
                try validate($0, name: "blueprintTypes[]", parent: name, max: 128)
                try validate($0, name: "blueprintTypes[]", parent: name, min: 1)
                try validate($0, name: "blueprintTypes[]", parent: name, pattern: "^[0-9a-zA-Z_\\-\\.]+$")
            }
            try self.validate(self.blueprintTypes, name: "blueprintTypes", parent: name, max: 1)
            try self.dependencies?.forEach {
                try $0.validate(name: "\(name).dependencies[]")
            }
            try self.validate(self.dependencies, name: "dependencies", parent: name, max: 1)
            try self.validate(self.handler, name: "handler", parent: name, max: 128)
            try self.validate(self.handler, name: "handler", parent: name, pattern: "^(([0-9a-zA-Z_-]+(\\/|\\.))*[0-9A-Za-z_\\\\-]+(\\.|::)[A-Za-z_][A-Za-z0-9_]*)?$")
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, max: 1024)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, min: 1)
            try self.validate(self.s3Key, name: "s3Key", parent: name, max: 1024)
            try self.validate(self.s3Key, name: "s3Key", parent: name, min: 1)
            try self.validate(self.s3Version, name: "s3Version", parent: name, max: 1024)
            try self.validate(self.s3Version, name: "s3Version", parent: name, min: 1)
            try self.validate(self.zipFile, name: "zipFile", parent: name, max: 10000000)
            try self.validate(self.zipFile, name: "zipFile", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case blueprintTypes = "BlueprintTypes"
            case dependencies = "Dependencies"
            case handler = "Handler"
            case s3Bucket = "S3Bucket"
            case s3Key = "S3Key"
            case s3Version = "S3Version"
            case zipFile = "ZipFile"
        }
    }

    public struct CanaryCodeOutput: AWSDecodableShape {
        ///  BlueprintTypes is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is multi-checks. Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify BlueprintTypes, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.  BlueprintTypes is supported only on canaries for syn-nodejs-3.0 runtime or later.
        public let blueprintTypes: [String]?
        /// A list of dependencies that are used for running this canary. The dependencies are specified as a key-value pair, where the key is the type of dependency and the value is the dependency reference.
        public let dependencies: [Dependency]?
        /// The entry point to use for the source code when running the canary. This field is required when you don't specify BlueprintTypes and is not allowed when you specify BlueprintTypes.
        public let handler: String?
        /// The ARN of the Lambda layer where Synthetics stores the canary script code.
        public let sourceLocationArn: String?

        @inlinable
        public init(blueprintTypes: [String]? = nil, dependencies: [Dependency]? = nil, handler: String? = nil, sourceLocationArn: String? = nil) {
            self.blueprintTypes = blueprintTypes
            self.dependencies = dependencies
            self.handler = handler
            self.sourceLocationArn = sourceLocationArn
        }

        private enum CodingKeys: String, CodingKey {
            case blueprintTypes = "BlueprintTypes"
            case dependencies = "Dependencies"
            case handler = "Handler"
            case sourceLocationArn = "SourceLocationArn"
        }
    }

    public struct CanaryDryRunConfigOutput: AWSDecodableShape {
        /// The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
        public let dryRunId: String?

        @inlinable
        public init(dryRunId: String? = nil) {
            self.dryRunId = dryRunId
        }

        private enum CodingKeys: String, CodingKey {
            case dryRunId = "DryRunId"
        }
    }

    public struct CanaryLastRun: AWSDecodableShape {
        /// The name of the canary.
        public let canaryName: String?
        /// The results from this canary's most recent run.
        public let lastRun: CanaryRun?

        @inlinable
        public init(canaryName: String? = nil, lastRun: CanaryRun? = nil) {
            self.canaryName = canaryName
            self.lastRun = lastRun
        }

        private enum CodingKeys: String, CodingKey {
            case canaryName = "CanaryName"
            case lastRun = "LastRun"
        }
    }

    public struct CanaryRun: AWSDecodableShape {
        /// The location where the canary stored artifacts from the run. Artifacts include  the log file, screenshots, and HAR files.
        public let artifactS3Location: String?
        /// The browser type associated with this canary run.
        public let browserType: BrowserType?
        /// Returns the dry run configurations for a canary.
        public let dryRunConfig: CanaryDryRunConfigOutput?
        /// A unique ID that identifies this canary run.
        public let id: String?
        /// The name of the canary.
        public let name: String?
        /// The count in number of the retry attempt.
        public let retryAttempt: Int?
        /// The ID of the scheduled canary run.
        public let scheduledRunId: String?
        /// The status of this run.
        public let status: CanaryRunStatus?
        /// A structure that contains the start and end times of this run.
        public let timeline: CanaryRunTimeline?

        @inlinable
        public init(artifactS3Location: String? = nil, browserType: BrowserType? = nil, dryRunConfig: CanaryDryRunConfigOutput? = nil, id: String? = nil, name: String? = nil, retryAttempt: Int? = nil, scheduledRunId: String? = nil, status: CanaryRunStatus? = nil, timeline: CanaryRunTimeline? = nil) {
            self.artifactS3Location = artifactS3Location
            self.browserType = browserType
            self.dryRunConfig = dryRunConfig
            self.id = id
            self.name = name
            self.retryAttempt = retryAttempt
            self.scheduledRunId = scheduledRunId
            self.status = status
            self.timeline = timeline
        }

        private enum CodingKeys: String, CodingKey {
            case artifactS3Location = "ArtifactS3Location"
            case browserType = "BrowserType"
            case dryRunConfig = "DryRunConfig"
            case id = "Id"
            case name = "Name"
            case retryAttempt = "RetryAttempt"
            case scheduledRunId = "ScheduledRunId"
            case status = "Status"
            case timeline = "Timeline"
        }
    }

    public struct CanaryRunConfigInput: AWSEncodableShape {
        /// Specifies whether this canary is to use active X-Ray tracing when it runs. Active tracing  enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does  not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see   Canaries and X-Ray tracing. You can enable active tracing only for canaries that use version syn-nodejs-2.0  or later for their canary runtime.
        public let activeTracing: Bool?
        /// Specifies the keys and values to use for any environment variables used in the canary script. Use the following format: { "key1" : "value1", "key2" : "value2", ...} Keys must start with a letter and be at least two characters. The total size of your environment variables cannot exceed 4 KB. You can't specify any Lambda reserved environment variables as the keys for your environment variables. For  more information about reserved keys, see  Runtime environment variables.  Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables  are not encrypted on the client side. Do not store sensitive information in them.
        public let environmentVariables: [String: String]?
        /// Specifies the amount of ephemeral storage (in MB) to allocate for the canary run during execution. This temporary storage is used for storing canary run artifacts (which are uploaded to an Amazon S3 bucket at the end of the run), and any canary browser operations. This temporary storage is cleared after the run is completed. Default storage value is 1024 MB.
        public let ephemeralStorage: Int?
        /// The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of 64.
        public let memoryInMB: Int?
        /// How long the canary is allowed to run before it must stop. You can't set this time to be longer than the frequency of the runs of this canary. If you omit this field, the frequency of the canary is used as this value, up to a maximum of 14 minutes.
        public let timeoutInSeconds: Int?

        @inlinable
        public init(activeTracing: Bool? = nil, environmentVariables: [String: String]? = nil, ephemeralStorage: Int? = nil, memoryInMB: Int? = nil, timeoutInSeconds: Int? = nil) {
            self.activeTracing = activeTracing
            self.environmentVariables = environmentVariables
            self.ephemeralStorage = ephemeralStorage
            self.memoryInMB = memoryInMB
            self.timeoutInSeconds = timeoutInSeconds
        }

        public func validate(name: String) throws {
            try self.environmentVariables?.forEach {
                try validate($0.key, name: "environmentVariables.key", parent: name, pattern: "^[a-zA-Z]([a-zA-Z0-9_])+$")
            }
            try self.validate(self.ephemeralStorage, name: "ephemeralStorage", parent: name, max: 10240)
            try self.validate(self.ephemeralStorage, name: "ephemeralStorage", parent: name, min: 1024)
            try self.validate(self.memoryInMB, name: "memoryInMB", parent: name, max: 3008)
            try self.validate(self.memoryInMB, name: "memoryInMB", parent: name, min: 960)
            try self.validate(self.timeoutInSeconds, name: "timeoutInSeconds", parent: name, max: 840)
            try self.validate(self.timeoutInSeconds, name: "timeoutInSeconds", parent: name, min: 3)
        }

        private enum CodingKeys: String, CodingKey {
            case activeTracing = "ActiveTracing"
            case environmentVariables = "EnvironmentVariables"
            case ephemeralStorage = "EphemeralStorage"
            case memoryInMB = "MemoryInMB"
            case timeoutInSeconds = "TimeoutInSeconds"
        }
    }

    public struct CanaryRunConfigOutput: AWSDecodableShape {
        /// Displays whether this canary run used active X-Ray tracing.
        public let activeTracing: Bool?
        /// Specifies the amount of ephemeral storage (in MB) to allocate for the canary run during execution. This temporary storage is used for storing canary run artifacts (which are uploaded to an Amazon S3 bucket at the end of the run), and any canary browser operations. This temporary storage is cleared after the run is completed. Default storage value is 1024 MB.
        public let ephemeralStorage: Int?
        /// The maximum amount of memory available to the canary while it is running, in MB. This value must be a multiple of 64.
        public let memoryInMB: Int?
        /// How long the canary is allowed to run before it must stop.
        public let timeoutInSeconds: Int?

        @inlinable
        public init(activeTracing: Bool? = nil, ephemeralStorage: Int? = nil, memoryInMB: Int? = nil, timeoutInSeconds: Int? = nil) {
            self.activeTracing = activeTracing
            self.ephemeralStorage = ephemeralStorage
            self.memoryInMB = memoryInMB
            self.timeoutInSeconds = timeoutInSeconds
        }

        private enum CodingKeys: String, CodingKey {
            case activeTracing = "ActiveTracing"
            case ephemeralStorage = "EphemeralStorage"
            case memoryInMB = "MemoryInMB"
            case timeoutInSeconds = "TimeoutInSeconds"
        }
    }

    public struct CanaryRunStatus: AWSDecodableShape {
        /// The current state of the run.
        public let state: CanaryRunState?
        /// If run of the canary failed, this field contains the reason for the error.
        public let stateReason: String?
        /// If this value is CANARY_FAILURE, either the canary script failed or Synthetics ran into a fatal error when running the canary. For example,  a canary timeout misconfiguration setting can cause the canary to timeout before Synthetics can evaluate its status.  If this value is EXECUTION_FAILURE, a non-critical failure occurred such as failing to save generated debug artifacts (for example, screenshots or har files). If both types of failures occurred, the CANARY_FAILURE takes precedence. To understand the exact error, use the StateReason API.
        public let stateReasonCode: CanaryRunStateReasonCode?
        /// Specifies the status of canary script for this run. When Synthetics tries to determine the status but fails, the result is marked as UNKNOWN. For the overall status of canary run, see State.
        public let testResult: CanaryRunTestResult?

        @inlinable
        public init(state: CanaryRunState? = nil, stateReason: String? = nil, stateReasonCode: CanaryRunStateReasonCode? = nil, testResult: CanaryRunTestResult? = nil) {
            self.state = state
            self.stateReason = stateReason
            self.stateReasonCode = stateReasonCode
            self.testResult = testResult
        }

        private enum CodingKeys: String, CodingKey {
            case state = "State"
            case stateReason = "StateReason"
            case stateReasonCode = "StateReasonCode"
            case testResult = "TestResult"
        }
    }

    public struct CanaryRunTimeline: AWSDecodableShape {
        /// The end time of the run.
        public let completed: Date?
        /// The time at which the metrics will be generated for this run or retries.
        public let metricTimestampForRunAndRetries: Date?
        /// The start time of the run.
        public let started: Date?

        @inlinable
        public init(completed: Date? = nil, metricTimestampForRunAndRetries: Date? = nil, started: Date? = nil) {
            self.completed = completed
            self.metricTimestampForRunAndRetries = metricTimestampForRunAndRetries
            self.started = started
        }

        private enum CodingKeys: String, CodingKey {
            case completed = "Completed"
            case metricTimestampForRunAndRetries = "MetricTimestampForRunAndRetries"
            case started = "Started"
        }
    }

    public struct CanaryScheduleInput: AWSEncodableShape {
        /// How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value. If you specify 0, the canary continues making runs until you stop it. If you omit this field, the default of 0 is used.
        public let durationInSeconds: Int64?
        /// A rate expression or a cron expression that defines how often the canary is to run. For a rate expression, The syntax is rate(number unit). unit can be minute, minutes, or hour.  For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every  10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour). Specifying rate(0 minute) or rate(0 hour) is a special value  that causes the  canary to run only once when it is started. Use cron(expression) to specify a cron  expression. You can't schedule a canary to wait for more than a year before running. For information about the syntax for cron expressions, see   Scheduling canary runs using cron.
        public let expression: String
        /// A structure that contains the retry configuration for a canary
        public let retryConfig: RetryConfigInput?

        @inlinable
        public init(durationInSeconds: Int64? = nil, expression: String, retryConfig: RetryConfigInput? = nil) {
            self.durationInSeconds = durationInSeconds
            self.expression = expression
            self.retryConfig = retryConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.durationInSeconds, name: "durationInSeconds", parent: name, max: 31622400)
            try self.validate(self.durationInSeconds, name: "durationInSeconds", parent: name, min: 0)
            try self.validate(self.expression, name: "expression", parent: name, max: 1024)
            try self.validate(self.expression, name: "expression", parent: name, min: 1)
            try self.retryConfig?.validate(name: "\(name).retryConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case durationInSeconds = "DurationInSeconds"
            case expression = "Expression"
            case retryConfig = "RetryConfig"
        }
    }

    public struct CanaryScheduleOutput: AWSDecodableShape {
        /// How long, in seconds, for the canary to continue making regular runs after it  was created. The runs are performed according to the schedule in the  Expression value.
        public let durationInSeconds: Int64?
        /// A rate expression or a cron expression that defines how often the canary is to run. For a rate expression, The syntax is rate(number unit). unit can be minute, minutes, or hour.  For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every  10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour). Specifying rate(0 minute) or rate(0 hour) is a special value  that causes the  canary to run only once when it is started. Use cron(expression) to specify a cron  expression. For information about the syntax for cron expressions, see   Scheduling canary runs using cron.
        public let expression: String?
        /// A structure that contains the retry configuration for a canary
        public let retryConfig: RetryConfigOutput?

        @inlinable
        public init(durationInSeconds: Int64? = nil, expression: String? = nil, retryConfig: RetryConfigOutput? = nil) {
            self.durationInSeconds = durationInSeconds
            self.expression = expression
            self.retryConfig = retryConfig
        }

        private enum CodingKeys: String, CodingKey {
            case durationInSeconds = "DurationInSeconds"
            case expression = "Expression"
            case retryConfig = "RetryConfig"
        }
    }

    public struct CanaryStatus: AWSDecodableShape {
        /// The current state of the canary.
        public let state: CanaryState?
        /// If the canary creation or update failed, this field provides details on the failure.
        public let stateReason: String?
        /// If the canary creation or update failed, this field displays the reason code.
        public let stateReasonCode: CanaryStateReasonCode?

        @inlinable
        public init(state: CanaryState? = nil, stateReason: String? = nil, stateReasonCode: CanaryStateReasonCode? = nil) {
            self.state = state
            self.stateReason = stateReason
            self.stateReasonCode = stateReasonCode
        }

        private enum CodingKeys: String, CodingKey {
            case state = "State"
            case stateReason = "StateReason"
            case stateReasonCode = "StateReasonCode"
        }
    }

    public struct CanaryTimeline: AWSDecodableShape {
        /// The date and time the canary was created.
        public let created: Date?
        /// The date and time the canary was most recently modified.
        public let lastModified: Date?
        /// The date and time that the canary's most recent run started.
        public let lastStarted: Date?
        /// The date and time that the canary's most recent run ended.
        public let lastStopped: Date?

        @inlinable
        public init(created: Date? = nil, lastModified: Date? = nil, lastStarted: Date? = nil, lastStopped: Date? = nil) {
            self.created = created
            self.lastModified = lastModified
            self.lastStarted = lastStarted
            self.lastStopped = lastStopped
        }

        private enum CodingKeys: String, CodingKey {
            case created = "Created"
            case lastModified = "LastModified"
            case lastStarted = "LastStarted"
            case lastStopped = "LastStopped"
        }
    }

    public struct CreateCanaryRequest: AWSEncodableShape {
        /// A structure that contains the configuration for canary artifacts, including  the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigInput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files.  The name of the  Amazon S3 bucket can't include a period (.).
        public let artifactS3Location: String
        /// CloudWatch Synthetics now supports multibrowser canaries for syn-nodejs-puppeteer-11.0 and syn-nodejs-playwright-3.0 runtimes. This feature allows you to run your canaries on both  Firefox and Chrome browsers. To create a multibrowser canary, you need to specify the BrowserConfigs with a list of browsers you want to use.  If not specified, browserConfigs defaults to Chrome.
        public let browserConfigs: [BrowserConfig]?
        /// A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an Amazon S3 bucket, the bucket name, key, and version are also included.
        public let code: CanaryCodeInput
        /// The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:PutLogEvents
        public let executionRoleArn: String
        /// The number of days to retain data about failed runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let failureRetentionPeriodInDays: Int?
        /// The name for this canary. Be sure to give it a descriptive name  that distinguishes it from other canaries in your account. Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
        public let name: String
        /// Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of AUTOMATIC is used, which means that the Lambda functions and layers will be deleted when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
        public let provisionedResourceCleanup: ProvisionedResourceCleanupSetting?
        /// To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this parameter with the value lambda-function. If you specify this parameter and don't specify any tags in the Tags parameter, the canary creation fails.
        public let resourcesToReplicateTags: [ResourceToTag]?
        /// A structure that contains the configuration for individual canary runs,  such as timeout value and environment variables.  Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables  are not encrypted on the client side. Do not store sensitive information in them.
        public let runConfig: CanaryRunConfigInput?
        /// Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String
        /// A structure that contains information about how often the canary is to run and when these test runs are to stop.
        public let schedule: CanaryScheduleInput
        /// The number of days to retain data about successful runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let successRetentionPeriodInDays: Int?
        /// A list of key-value pairs to associate with the canary.  You can associate as many as 50 tags with a canary. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values. To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this parameter with the value lambda-function.
        public let tags: [String: String]?
        /// If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
        public let vpcConfig: VpcConfigInput?

        @inlinable
        public init(artifactConfig: ArtifactConfigInput? = nil, artifactS3Location: String, browserConfigs: [BrowserConfig]? = nil, code: CanaryCodeInput, executionRoleArn: String, failureRetentionPeriodInDays: Int? = nil, name: String, provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil, resourcesToReplicateTags: [ResourceToTag]? = nil, runConfig: CanaryRunConfigInput? = nil, runtimeVersion: String, schedule: CanaryScheduleInput, successRetentionPeriodInDays: Int? = nil, tags: [String: String]? = nil, vpcConfig: VpcConfigInput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.browserConfigs = browserConfigs
            self.code = code
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.name = name
            self.provisionedResourceCleanup = provisionedResourceCleanup
            self.resourcesToReplicateTags = resourcesToReplicateTags
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.tags = tags
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.artifactConfig?.validate(name: "\(name).artifactConfig")
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, max: 1024)
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, min: 1)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, max: 2)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, min: 1)
            try self.code.validate(name: "\(name).code")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 1)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.validate(self.resourcesToReplicateTags, name: "resourcesToReplicateTags", parent: name, max: 1)
            try self.validate(self.resourcesToReplicateTags, name: "resourcesToReplicateTags", parent: name, min: 1)
            try self.runConfig?.validate(name: "\(name).runConfig")
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, max: 1024)
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, min: 1)
            try self.schedule.validate(name: "\(name).schedule")
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, min: 1)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case browserConfigs = "BrowserConfigs"
            case code = "Code"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case name = "Name"
            case provisionedResourceCleanup = "ProvisionedResourceCleanup"
            case resourcesToReplicateTags = "ResourcesToReplicateTags"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case tags = "Tags"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CreateCanaryResponse: AWSDecodableShape {
        /// The full details about the canary you have created.
        public let canary: Canary?

        @inlinable
        public init(canary: Canary? = nil) {
            self.canary = canary
        }

        private enum CodingKeys: String, CodingKey {
            case canary = "Canary"
        }
    }

    public struct CreateGroupRequest: AWSEncodableShape {
        /// The name for the group. It can include any Unicode characters. The names for all groups in your account, across all Regions, must be unique.
        public let name: String
        /// A list of key-value pairs to associate with the group.  You can associate as many as 50 tags with a group. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by  granting a user permission to access or change only the resources that have certain tag values.
        public let tags: [String: String]?

        @inlinable
        public init(name: String, tags: [String: String]? = nil) {
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct CreateGroupResponse: AWSDecodableShape {
        /// A structure that contains information about the group that was just created.
        public let group: Group?

        @inlinable
        public init(group: Group? = nil) {
            self.group = group
        }

        private enum CodingKeys: String, CodingKey {
            case group = "Group"
        }
    }

    public struct DeleteCanaryRequest: AWSEncodableShape {
        /// Specifies whether to also delete the Lambda functions and layers used by this canary. The default is false. Your setting for this parameter is used only if the canary doesn't have AUTOMATIC for its  ProvisionedResourceCleanup field. If that field is set to AUTOMATIC, then the  Lambda functions and layers will be deleted when this canary is deleted.  Type: Boolean
        public let deleteLambda: Bool?
        /// The name of the canary that you want to delete. To find the names of your canaries, use DescribeCanaries.
        public let name: String

        @inlinable
        public init(deleteLambda: Bool? = nil, name: String) {
            self.deleteLambda = deleteLambda
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.deleteLambda, key: "deleteLambda")
            request.encodePath(self.name, key: "Name")
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteGroupRequest: AWSEncodableShape {
        /// Specifies which group to delete. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String

        @inlinable
        public init(groupIdentifier: String) {
            self.groupIdentifier = groupIdentifier
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.groupIdentifier, key: "GroupIdentifier")
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteGroupResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Dependency: AWSEncodableShape & AWSDecodableShape {
        /// The dependency reference. For Lambda layers, this is the ARN of the Lambda layer. For more information  about Lambda ARN format, see Lambda.
        public let reference: String
        /// The type of dependency. Valid value is LambdaLayer.
        public let type: DependencyType?

        @inlinable
        public init(reference: String, type: DependencyType? = nil) {
            self.reference = reference
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.reference, name: "reference", parent: name, max: 1024)
            try self.validate(self.reference, name: "reference", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case reference = "Reference"
            case type = "Type"
        }
    }

    public struct DescribeCanariesLastRunRequest: AWSEncodableShape {
        /// The type of browser to use for the canary run.
        public let browserType: BrowserType?
        /// Specify this parameter to limit how many runs are returned each time you use the DescribeLastRun operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use the Names parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
        public let names: [String]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(browserType: BrowserType? = nil, maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil) {
            self.browserType = browserType
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 255)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^[0-9a-z_\\-]+$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 5)
            try self.validate(self.names, name: "names", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case browserType = "BrowserType"
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesLastRunResponse: AWSDecodableShape {
        /// An array that contains the information from the most recent run of each canary.
        public let canariesLastRun: [CanaryLastRun]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(canariesLastRun: [CanaryLastRun]? = nil, nextToken: String? = nil) {
            self.canariesLastRun = canariesLastRun
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canariesLastRun = "CanariesLastRun"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many canaries are returned each time you use the DescribeCanaries operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names. If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of  the canaries, the request fails with a 403 response. You are required to use this parameter if you are logged on to a user or role that has an  IAM policy that restricts which canaries that you are allowed to view. For more information,  see  Limiting a user to viewing specific canaries.
        public let names: [String]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 255)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^[0-9a-z_\\-]+$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 5)
            try self.validate(self.names, name: "names", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeCanariesResponse: AWSDecodableShape {
        /// Returns an array. Each item in the array contains the full information about one canary.
        public let canaries: [Canary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanaries operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(canaries: [Canary]? = nil, nextToken: String? = nil) {
            self.canaries = canaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canaries = "Canaries"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeRuntimeVersionsRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many runs are returned each time you use the DescribeRuntimeVersions operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeRuntimeVersions operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeRuntimeVersionsResponse: AWSDecodableShape {
        /// A token that indicates that there is more data available. You can use this token in a subsequent DescribeRuntimeVersions operation to retrieve the next  set of results.
        public let nextToken: String?
        /// An array of objects that display the details about each Synthetics canary runtime version.
        public let runtimeVersions: [RuntimeVersion]?

        @inlinable
        public init(nextToken: String? = nil, runtimeVersions: [RuntimeVersion]? = nil) {
            self.nextToken = nextToken
            self.runtimeVersions = runtimeVersions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case runtimeVersions = "RuntimeVersions"
        }
    }

    public struct DisassociateResourceRequest: AWSEncodableShape {
        /// Specifies the group. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// The ARN of the canary that you want to remove from the specified group.
        public let resourceArn: String

        @inlinable
        public init(groupIdentifier: String, resourceArn: String) {
            self.groupIdentifier = groupIdentifier
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.groupIdentifier, key: "GroupIdentifier")
            try container.encode(self.resourceArn, forKey: .resourceArn)
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct DisassociateResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DryRunConfigOutput: AWSDecodableShape {
        /// The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
        public let dryRunId: String?
        /// Returns the last execution status for a canary's dry run.
        public let lastDryRunExecutionStatus: String?

        @inlinable
        public init(dryRunId: String? = nil, lastDryRunExecutionStatus: String? = nil) {
            self.dryRunId = dryRunId
            self.lastDryRunExecutionStatus = lastDryRunExecutionStatus
        }

        private enum CodingKeys: String, CodingKey {
            case dryRunId = "DryRunId"
            case lastDryRunExecutionStatus = "LastDryRunExecutionStatus"
        }
    }

    public struct EngineConfig: AWSDecodableShape {
        /// The browser type associated with this engine configuration.
        public let browserType: BrowserType?
        /// Each engine configuration contains the ARN of the Lambda function that is used as the canary's engine for a specific browser type.
        public let engineArn: String?

        @inlinable
        public init(browserType: BrowserType? = nil, engineArn: String? = nil) {
            self.browserType = browserType
            self.engineArn = engineArn
        }

        private enum CodingKeys: String, CodingKey {
            case browserType = "BrowserType"
            case engineArn = "EngineArn"
        }
    }

    public struct GetCanaryRequest: AWSEncodableShape {
        /// The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
        public let dryRunId: String?
        /// The name of the canary that you want details for.
        public let name: String

        @inlinable
        public init(dryRunId: String? = nil, name: String) {
            self.dryRunId = dryRunId
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.dryRunId, key: "dryRunId")
            request.encodePath(self.name, key: "Name")
        }

        public func validate(name: String) throws {
            try self.validate(self.dryRunId, name: "dryRunId", parent: name, pattern: "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetCanaryResponse: AWSDecodableShape {
        /// A structure that contains the full information about the canary.
        public let canary: Canary?

        @inlinable
        public init(canary: Canary? = nil) {
            self.canary = canary
        }

        private enum CodingKeys: String, CodingKey {
            case canary = "Canary"
        }
    }

    public struct GetCanaryRunsRequest: AWSEncodableShape {
        /// The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.
        public let dryRunId: String?
        /// Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.
        public let maxResults: Int?
        /// The name of the canary that you want to see runs for.
        public let name: String
        /// A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns operation to retrieve the next  set of results.  When auto retry is enabled for the canary, the first subsequent retry is suffixed with *1 indicating its the first retry and the next subsequent try is suffixed with *2.
        public let nextToken: String?
        ///   When you provide RunType=CANARY_RUN and dryRunId, you will get an exception      When a value is not provided for RunType, the default value is CANARY_RUN    When CANARY_RUN is provided, all canary runs excluding dry runs are returned   When DRY_RUN is provided, all dry runs excluding canary runs are returned
        public let runType: RunType?

        @inlinable
        public init(dryRunId: String? = nil, maxResults: Int? = nil, name: String, nextToken: String? = nil, runType: RunType? = nil) {
            self.dryRunId = dryRunId
            self.maxResults = maxResults
            self.name = name
            self.nextToken = nextToken
            self.runType = runType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.dryRunId, forKey: .dryRunId)
            try container.encodeIfPresent(self.maxResults, forKey: .maxResults)
            request.encodePath(self.name, key: "Name")
            try container.encodeIfPresent(self.nextToken, forKey: .nextToken)
            try container.encodeIfPresent(self.runType, forKey: .runType)
        }

        public func validate(name: String) throws {
            try self.validate(self.dryRunId, name: "dryRunId", parent: name, pattern: "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 252)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 4)
        }

        private enum CodingKeys: String, CodingKey {
            case dryRunId = "DryRunId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case runType = "RunType"
        }
    }

    public struct GetCanaryRunsResponse: AWSDecodableShape {
        /// An array of structures. Each structure contains the details of one of the  retrieved canary runs.
        public let canaryRuns: [CanaryRun]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns  operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(canaryRuns: [CanaryRun]? = nil, nextToken: String? = nil) {
            self.canaryRuns = canaryRuns
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case canaryRuns = "CanaryRuns"
            case nextToken = "NextToken"
        }
    }

    public struct GetGroupRequest: AWSEncodableShape {
        /// Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String

        @inlinable
        public init(groupIdentifier: String) {
            self.groupIdentifier = groupIdentifier
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.groupIdentifier, key: "GroupIdentifier")
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetGroupResponse: AWSDecodableShape {
        /// A structure that contains information about the group.
        public let group: Group?

        @inlinable
        public init(group: Group? = nil) {
            self.group = group
        }

        private enum CodingKeys: String, CodingKey {
            case group = "Group"
        }
    }

    public struct Group: AWSDecodableShape {
        /// The ARN of the group.
        public let arn: String?
        /// The date and time that the group was created.
        public let createdTime: Date?
        /// The unique ID of the group.
        public let id: String?
        /// The date and time that the group was most recently updated.
        public let lastModifiedTime: Date?
        /// The name of the group.
        public let name: String?
        /// The list of key-value pairs that are associated with the canary.
        public let tags: [String: String]?

        @inlinable
        public init(arn: String? = nil, createdTime: Date? = nil, id: String? = nil, lastModifiedTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.createdTime = createdTime
            self.id = id
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case id = "Id"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case tags = "Tags"
        }
    }

    public struct GroupSummary: AWSDecodableShape {
        /// The ARN of the group.
        public let arn: String?
        /// The unique ID of the group.
        public let id: String?
        /// The name of the group.
        public let name: String?

        @inlinable
        public init(arn: String? = nil, id: String? = nil, name: String? = nil) {
            self.arn = arn
            self.id = id
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case id = "Id"
            case name = "Name"
        }
    }

    public struct ListAssociatedGroupsRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many groups are returned each time you use the ListAssociatedGroups operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?
        /// The ARN of the canary that you want to view groups for.
        public let resourceArn: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.maxResults, forKey: .maxResults)
            try container.encodeIfPresent(self.nextToken, forKey: .nextToken)
            request.encodePath(self.resourceArn, key: "ResourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListAssociatedGroupsResponse: AWSDecodableShape {
        /// An array of structures that contain information about the groups that this canary is associated with.
        public let groups: [GroupSummary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListAssociatedGroups operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(groups: [GroupSummary]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupResourcesRequest: AWSEncodableShape {
        /// Specifies the group to return information for. You can specify the group name, the ARN, or the  group ID as the GroupIdentifier.
        public let groupIdentifier: String
        /// Specify this parameter to limit how many canary ARNs are returned each time you use the ListGroupResources operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(groupIdentifier: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.groupIdentifier = groupIdentifier
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.groupIdentifier, key: "GroupIdentifier")
            try container.encodeIfPresent(self.maxResults, forKey: .maxResults)
            try container.encodeIfPresent(self.nextToken, forKey: .nextToken)
        }

        public func validate(name: String) throws {
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, max: 128)
            try self.validate(self.groupIdentifier, name: "groupIdentifier", parent: name, min: 1)
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupResourcesResponse: AWSDecodableShape {
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListGroupResources operation to retrieve the next  set of results.
        public let nextToken: String?
        /// An array of ARNs. These ARNs are for the canaries that are associated with the group.
        public let resources: [String]?

        @inlinable
        public init(nextToken: String? = nil, resources: [String]? = nil) {
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resources = "Resources"
        }
    }

    public struct ListGroupsRequest: AWSEncodableShape {
        /// Specify this parameter to limit how many groups are returned each time you use the ListGroups operation. If you omit this parameter, the default of 20 is used.
        public let maxResults: Int?
        /// A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 20)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 512)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGroupsResponse: AWSDecodableShape {
        /// An array of structures that each contain information about one group.
        public let groups: [GroupSummary]?
        /// A token that indicates that there is more data available. You can use this token in a subsequent ListGroups operation to retrieve the next  set of results.
        public let nextToken: String?

        @inlinable
        public init(groups: [GroupSummary]? = nil, nextToken: String? = nil) {
            self.groups = groups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case groups = "Groups"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The ARN of the canary or group that you want to view tags for. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "ResourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The list of tag keys and values associated with the resource that you specified.
        public let tags: [String: String]?

        @inlinable
        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct RetryConfigInput: AWSEncodableShape {
        /// The maximum number of retries. The value must be less than or equal to 2.
        public let maxRetries: Int

        @inlinable
        public init(maxRetries: Int) {
            self.maxRetries = maxRetries
        }

        public func validate(name: String) throws {
            try self.validate(self.maxRetries, name: "maxRetries", parent: name, max: 2)
            try self.validate(self.maxRetries, name: "maxRetries", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case maxRetries = "MaxRetries"
        }
    }

    public struct RetryConfigOutput: AWSDecodableShape {
        /// The maximum number of retries. The value must be less than or equal to 2.
        public let maxRetries: Int?

        @inlinable
        public init(maxRetries: Int? = nil) {
            self.maxRetries = maxRetries
        }

        private enum CodingKeys: String, CodingKey {
            case maxRetries = "MaxRetries"
        }
    }

    public struct RuntimeVersion: AWSDecodableShape {
        /// If this runtime version is deprecated, this value is the date of deprecation.
        public let deprecationDate: Date?
        /// A description of the runtime version, created by Amazon.
        public let description: String?
        /// The date that the runtime version was released.
        public let releaseDate: Date?
        /// The name of the runtime version. For a list of valid runtime versions,  see  Canary Runtime Versions.
        public let versionName: String?

        @inlinable
        public init(deprecationDate: Date? = nil, description: String? = nil, releaseDate: Date? = nil, versionName: String? = nil) {
            self.deprecationDate = deprecationDate
            self.description = description
            self.releaseDate = releaseDate
            self.versionName = versionName
        }

        private enum CodingKeys: String, CodingKey {
            case deprecationDate = "DeprecationDate"
            case description = "Description"
            case releaseDate = "ReleaseDate"
            case versionName = "VersionName"
        }
    }

    public struct S3EncryptionConfig: AWSEncodableShape & AWSDecodableShape {
        ///  The encryption method to use for artifacts created by this canary. Specify SSE_S3 to use server-side encryption (SSE) with an Amazon S3-managed key. Specify SSE-KMS to use server-side encryption with a customer-managed KMS key. If you omit this parameter, an  Amazon Web Services-managed KMS key is used.
        public let encryptionMode: EncryptionMode?
        /// The ARN of the customer-managed KMS key to use, if you specify SSE-KMS for EncryptionMode
        public let kmsKeyArn: String?

        @inlinable
        public init(encryptionMode: EncryptionMode? = nil, kmsKeyArn: String? = nil) {
            self.encryptionMode = encryptionMode
            self.kmsKeyArn = kmsKeyArn
        }

        public func validate(name: String) throws {
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 2048)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 1)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:kms:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:key/[\\w\\-\\/]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionMode = "EncryptionMode"
            case kmsKeyArn = "KmsKeyArn"
        }
    }

    public struct StartCanaryDryRunRequest: AWSEncodableShape {
        public let artifactConfig: ArtifactConfigInput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the test runs of this
        ///  canary. Artifacts include the log file, screenshots, and HAR files.  The name of the  Amazon S3 bucket can't include a period (.).
        public let artifactS3Location: String?
        /// A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.  If not specified, browserConfigs defaults to Chrome.
        public let browserConfigs: [BrowserConfig]?
        public let code: CanaryCodeInput?
        /// The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:
        public let executionRoleArn: String?
        /// The number of days to retain data about failed runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let failureRetentionPeriodInDays: Int?
        /// The name of the canary that you want to dry run. To find canary names, use DescribeCanaries.
        public let name: String
        /// Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of AUTOMATIC is used, which means
        ///  that the Lambda functions and layers will be deleted when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
        public let provisionedResourceCleanup: ProvisionedResourceCleanupSetting?
        public let runConfig: CanaryRunConfigInput?
        /// Specifies the runtime version to use for the canary.   For a list of valid runtime versions and for more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String?
        /// The number of days to retain data about successful runs of this canary. If you omit  this field, the default of 31 days is used. The valid range is 1 to 455 days. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let successRetentionPeriodInDays: Int?
        public let visualReference: VisualReferenceInput?
        /// A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.  syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported. Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility.
        public let visualReferences: [VisualReferenceInput]?
        public let vpcConfig: VpcConfigInput?

        @inlinable
        public init(artifactConfig: ArtifactConfigInput? = nil, artifactS3Location: String? = nil, browserConfigs: [BrowserConfig]? = nil, code: CanaryCodeInput? = nil, executionRoleArn: String? = nil, failureRetentionPeriodInDays: Int? = nil, name: String, provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil, runConfig: CanaryRunConfigInput? = nil, runtimeVersion: String? = nil, successRetentionPeriodInDays: Int? = nil, visualReference: VisualReferenceInput? = nil, visualReferences: [VisualReferenceInput]? = nil, vpcConfig: VpcConfigInput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.browserConfigs = browserConfigs
            self.code = code
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.name = name
            self.provisionedResourceCleanup = provisionedResourceCleanup
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.visualReference = visualReference
            self.visualReferences = visualReferences
            self.vpcConfig = vpcConfig
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.artifactConfig, forKey: .artifactConfig)
            try container.encodeIfPresent(self.artifactS3Location, forKey: .artifactS3Location)
            try container.encodeIfPresent(self.browserConfigs, forKey: .browserConfigs)
            try container.encodeIfPresent(self.code, forKey: .code)
            try container.encodeIfPresent(self.executionRoleArn, forKey: .executionRoleArn)
            try container.encodeIfPresent(self.failureRetentionPeriodInDays, forKey: .failureRetentionPeriodInDays)
            request.encodePath(self.name, key: "Name")
            try container.encodeIfPresent(self.provisionedResourceCleanup, forKey: .provisionedResourceCleanup)
            try container.encodeIfPresent(self.runConfig, forKey: .runConfig)
            try container.encodeIfPresent(self.runtimeVersion, forKey: .runtimeVersion)
            try container.encodeIfPresent(self.successRetentionPeriodInDays, forKey: .successRetentionPeriodInDays)
            try container.encodeIfPresent(self.visualReference, forKey: .visualReference)
            try container.encodeIfPresent(self.visualReferences, forKey: .visualReferences)
            try container.encodeIfPresent(self.vpcConfig, forKey: .vpcConfig)
        }

        public func validate(name: String) throws {
            try self.artifactConfig?.validate(name: "\(name).artifactConfig")
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, max: 1024)
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, min: 1)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, max: 2)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, min: 1)
            try self.code?.validate(name: "\(name).code")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 1)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.runConfig?.validate(name: "\(name).runConfig")
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, max: 1024)
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, min: 1)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, min: 1)
            try self.visualReference?.validate(name: "\(name).visualReference")
            try self.visualReferences?.forEach {
                try $0.validate(name: "\(name).visualReferences[]")
            }
            try self.validate(self.visualReferences, name: "visualReferences", parent: name, max: 2)
            try self.validate(self.visualReferences, name: "visualReferences", parent: name, min: 1)
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case browserConfigs = "BrowserConfigs"
            case code = "Code"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case provisionedResourceCleanup = "ProvisionedResourceCleanup"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case visualReference = "VisualReference"
            case visualReferences = "VisualReferences"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct StartCanaryDryRunResponse: AWSDecodableShape {
        /// Returns the dry run configurations for a canary.
        public let dryRunConfig: DryRunConfigOutput?

        @inlinable
        public init(dryRunConfig: DryRunConfigOutput? = nil) {
            self.dryRunConfig = dryRunConfig
        }

        private enum CodingKeys: String, CodingKey {
            case dryRunConfig = "DryRunConfig"
        }
    }

    public struct StartCanaryRequest: AWSEncodableShape {
        /// The name of the canary that you want to run. To find canary names, use DescribeCanaries.
        public let name: String

        @inlinable
        public init(name: String) {
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.name, key: "Name")
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StartCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct StopCanaryRequest: AWSEncodableShape {
        /// The name of the canary that you want to stop. To find the names of your  canaries, use ListCanaries.
        public let name: String

        @inlinable
        public init(name: String) {
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.name, key: "Name")
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StopCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The ARN of the canary or group that you're adding tags to. The ARN format of a canary is
        /// arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String
        /// The list of key-value pairs to associate with the resource.
        public let tags: [String: String]

        @inlinable
        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "ResourceArn")
            try container.encode(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The ARN of the canary or group that you're removing tags from. The ARN format of a canary is arn:aws:synthetics:Region:account-id:canary:canary-name . The ARN format of a group is arn:aws:synthetics:Region:account-id:group:group-name
        public let resourceArn: String
        /// The list of tag keys to remove from the resource.
        public let tagKeys: [String]

        @inlinable
        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "ResourceArn")
            request.encodeQuery(self.tagKeys, key: "tagKeys")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateCanaryRequest: AWSEncodableShape {
        /// A structure that contains the configuration for canary artifacts,  including the encryption-at-rest settings for artifacts that  the canary uploads to Amazon S3.
        public let artifactConfig: ArtifactConfigInput?
        /// The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.  Artifacts include the log file, screenshots, and HAR files. The name of the Amazon S3 bucket can't include a period (.).
        public let artifactS3Location: String?
        /// A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.  If not specified, browserConfigs defaults to Chrome.
        public let browserConfigs: [BrowserConfig]?
        /// A structure that includes the entry point from which the canary should start running your script. If the script is stored in  an Amazon S3 bucket, the bucket name, key, and version are also included.
        public let code: CanaryCodeInput?
        /// Update the existing canary using the updated configurations from the DryRun associated with the DryRunId.  When you use the dryRunId field when updating a canary, the only other field you can provide is the Schedule. Adding any other field will thrown an exception.
        public let dryRunId: String?
        /// The ARN of the IAM role to be used to run the canary. This role must already exist,  and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:    s3:PutObject     s3:GetBucketLocation     s3:ListAllMyBuckets     cloudwatch:PutMetricData     logs:CreateLogGroup     logs:CreateLogStream     logs:CreateLogStream
        public let executionRoleArn: String?
        /// The number of days to retain data about failed runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let failureRetentionPeriodInDays: Int?
        /// The name of the canary that you want to update. To find the names of your  canaries, use DescribeCanaries. You cannot change the name of a canary that has already been created.
        public let name: String
        /// Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
        public let provisionedResourceCleanup: ProvisionedResourceCleanupSetting?
        /// A structure that contains the timeout value that is used for each individual run of the  canary.  Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables  are not encrypted on the client side. Do not store sensitive information in them.
        public let runConfig: CanaryRunConfigInput?
        /// Specifies the runtime version to use for the canary.   For a list of valid runtime versions and for more information about runtime versions, see  Canary Runtime Versions.
        public let runtimeVersion: String?
        /// A structure that contains information about how often the canary is to run, and when these runs are to stop.
        public let schedule: CanaryScheduleInput?
        /// The number of days to retain data about successful runs of this canary. This setting affects the range of information returned by GetCanaryRuns, as well as  the range of information displayed in the Synthetics console.
        public let successRetentionPeriodInDays: Int?
        /// Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this  parameter, no changes are made to any baseline screenshots that the canary might be using already. Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see  Visual monitoring and  Visual monitoring blueprint
        public let visualReference: VisualReferenceInput?
        /// A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.  syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported. Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility. For multibrowser visual monitoring,  you can update the baseline for all configured browsers in a single update call by specifying a list of VisualReference objects, one per browser.  Each VisualReference object maps to a specific browser configuration, allowing you to manage visual baselines for multiple browsers simultaneously. For single configuration canaries using Chrome browser (default browser), use visualReferences for syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and  above canaries. The browserType in the visualReference object is not mandatory.
        public let visualReferences: [VisualReferenceInput]?
        /// If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.  For more information, see  Running a Canary in a VPC.
        public let vpcConfig: VpcConfigInput?

        @inlinable
        public init(artifactConfig: ArtifactConfigInput? = nil, artifactS3Location: String? = nil, browserConfigs: [BrowserConfig]? = nil, code: CanaryCodeInput? = nil, dryRunId: String? = nil, executionRoleArn: String? = nil, failureRetentionPeriodInDays: Int? = nil, name: String, provisionedResourceCleanup: ProvisionedResourceCleanupSetting? = nil, runConfig: CanaryRunConfigInput? = nil, runtimeVersion: String? = nil, schedule: CanaryScheduleInput? = nil, successRetentionPeriodInDays: Int? = nil, visualReference: VisualReferenceInput? = nil, visualReferences: [VisualReferenceInput]? = nil, vpcConfig: VpcConfigInput? = nil) {
            self.artifactConfig = artifactConfig
            self.artifactS3Location = artifactS3Location
            self.browserConfigs = browserConfigs
            self.code = code
            self.dryRunId = dryRunId
            self.executionRoleArn = executionRoleArn
            self.failureRetentionPeriodInDays = failureRetentionPeriodInDays
            self.name = name
            self.provisionedResourceCleanup = provisionedResourceCleanup
            self.runConfig = runConfig
            self.runtimeVersion = runtimeVersion
            self.schedule = schedule
            self.successRetentionPeriodInDays = successRetentionPeriodInDays
            self.visualReference = visualReference
            self.visualReferences = visualReferences
            self.vpcConfig = vpcConfig
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.artifactConfig, forKey: .artifactConfig)
            try container.encodeIfPresent(self.artifactS3Location, forKey: .artifactS3Location)
            try container.encodeIfPresent(self.browserConfigs, forKey: .browserConfigs)
            try container.encodeIfPresent(self.code, forKey: .code)
            try container.encodeIfPresent(self.dryRunId, forKey: .dryRunId)
            try container.encodeIfPresent(self.executionRoleArn, forKey: .executionRoleArn)
            try container.encodeIfPresent(self.failureRetentionPeriodInDays, forKey: .failureRetentionPeriodInDays)
            request.encodePath(self.name, key: "Name")
            try container.encodeIfPresent(self.provisionedResourceCleanup, forKey: .provisionedResourceCleanup)
            try container.encodeIfPresent(self.runConfig, forKey: .runConfig)
            try container.encodeIfPresent(self.runtimeVersion, forKey: .runtimeVersion)
            try container.encodeIfPresent(self.schedule, forKey: .schedule)
            try container.encodeIfPresent(self.successRetentionPeriodInDays, forKey: .successRetentionPeriodInDays)
            try container.encodeIfPresent(self.visualReference, forKey: .visualReference)
            try container.encodeIfPresent(self.visualReferences, forKey: .visualReferences)
            try container.encodeIfPresent(self.vpcConfig, forKey: .vpcConfig)
        }

        public func validate(name: String) throws {
            try self.artifactConfig?.validate(name: "\(name).artifactConfig")
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, max: 1024)
            try self.validate(self.artifactS3Location, name: "artifactS3Location", parent: name, min: 1)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, max: 2)
            try self.validate(self.browserConfigs, name: "browserConfigs", parent: name, min: 1)
            try self.code?.validate(name: "\(name).code")
            try self.validate(self.dryRunId, name: "dryRunId", parent: name, pattern: "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 1)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$")
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.failureRetentionPeriodInDays, name: "failureRetentionPeriodInDays", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9a-z_\\-]+$")
            try self.runConfig?.validate(name: "\(name).runConfig")
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, max: 1024)
            try self.validate(self.runtimeVersion, name: "runtimeVersion", parent: name, min: 1)
            try self.schedule?.validate(name: "\(name).schedule")
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, max: 1024)
            try self.validate(self.successRetentionPeriodInDays, name: "successRetentionPeriodInDays", parent: name, min: 1)
            try self.visualReference?.validate(name: "\(name).visualReference")
            try self.visualReferences?.forEach {
                try $0.validate(name: "\(name).visualReferences[]")
            }
            try self.validate(self.visualReferences, name: "visualReferences", parent: name, max: 2)
            try self.validate(self.visualReferences, name: "visualReferences", parent: name, min: 1)
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case artifactConfig = "ArtifactConfig"
            case artifactS3Location = "ArtifactS3Location"
            case browserConfigs = "BrowserConfigs"
            case code = "Code"
            case dryRunId = "DryRunId"
            case executionRoleArn = "ExecutionRoleArn"
            case failureRetentionPeriodInDays = "FailureRetentionPeriodInDays"
            case provisionedResourceCleanup = "ProvisionedResourceCleanup"
            case runConfig = "RunConfig"
            case runtimeVersion = "RuntimeVersion"
            case schedule = "Schedule"
            case successRetentionPeriodInDays = "SuccessRetentionPeriodInDays"
            case visualReference = "VisualReference"
            case visualReferences = "VisualReferences"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct UpdateCanaryResponse: AWSDecodableShape {
        public init() {}
    }

    public struct VisualReferenceInput: AWSEncodableShape {
        /// Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are  nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run  before this update was made, or the value of Id in the  CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days,  the operation returns a 400 validation exception error..
        public let baseCanaryRunId: String
        /// An array of screenshots that will be used as the baseline for visual monitoring in future runs of this canary. If there is a screenshot that you don't want to be used for visual monitoring, remove it from this array.
        public let baseScreenshots: [BaseScreenshot]?
        /// The browser type associated with this visual reference.
        public let browserType: BrowserType?

        @inlinable
        public init(baseCanaryRunId: String, baseScreenshots: [BaseScreenshot]? = nil, browserType: BrowserType? = nil) {
            self.baseCanaryRunId = baseCanaryRunId
            self.baseScreenshots = baseScreenshots
            self.browserType = browserType
        }

        public func validate(name: String) throws {
            try self.validate(self.baseCanaryRunId, name: "baseCanaryRunId", parent: name, max: 1024)
            try self.validate(self.baseCanaryRunId, name: "baseCanaryRunId", parent: name, min: 1)
            try self.baseScreenshots?.forEach {
                try $0.validate(name: "\(name).baseScreenshots[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case baseCanaryRunId = "BaseCanaryRunId"
            case baseScreenshots = "BaseScreenshots"
            case browserType = "BrowserType"
        }
    }

    public struct VisualReferenceOutput: AWSDecodableShape {
        /// The ID of the canary run that produced the baseline screenshots  that are used for visual monitoring comparisons by this canary.
        public let baseCanaryRunId: String?
        /// An array of screenshots that are used as the baseline for comparisons during visual monitoring.
        public let baseScreenshots: [BaseScreenshot]?
        /// The browser type associated with this visual reference.
        public let browserType: BrowserType?

        @inlinable
        public init(baseCanaryRunId: String? = nil, baseScreenshots: [BaseScreenshot]? = nil, browserType: BrowserType? = nil) {
            self.baseCanaryRunId = baseCanaryRunId
            self.baseScreenshots = baseScreenshots
            self.browserType = browserType
        }

        private enum CodingKeys: String, CodingKey {
            case baseCanaryRunId = "BaseCanaryRunId"
            case baseScreenshots = "BaseScreenshots"
            case browserType = "BrowserType"
        }
    }

    public struct VpcConfigInput: AWSEncodableShape {
        /// Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false
        public let ipv6AllowedForDualStack: Bool?
        /// The IDs of the security groups for this canary.
        public let securityGroupIds: [String]?
        /// The IDs of the subnets where this canary is to run.
        public let subnetIds: [String]?

        @inlinable
        public init(ipv6AllowedForDualStack: Bool? = nil, securityGroupIds: [String]? = nil, subnetIds: [String]? = nil) {
            self.ipv6AllowedForDualStack = ipv6AllowedForDualStack
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 5)
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 16)
        }

        private enum CodingKeys: String, CodingKey {
            case ipv6AllowedForDualStack = "Ipv6AllowedForDualStack"
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
        }
    }

    public struct VpcConfigOutput: AWSDecodableShape {
        /// Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.
        public let ipv6AllowedForDualStack: Bool?
        /// The IDs of the security groups for this canary.
        public let securityGroupIds: [String]?
        /// The IDs of the subnets where this canary is to run.
        public let subnetIds: [String]?
        /// The IDs of the VPC where this canary is to run.
        public let vpcId: String?

        @inlinable
        public init(ipv6AllowedForDualStack: Bool? = nil, securityGroupIds: [String]? = nil, subnetIds: [String]? = nil, vpcId: String? = nil) {
            self.ipv6AllowedForDualStack = ipv6AllowedForDualStack
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case ipv6AllowedForDualStack = "Ipv6AllowedForDualStack"
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
            case vpcId = "VpcId"
        }
    }
}

// MARK: - Errors

/// Error enum for Synthetics
public struct SyntheticsErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case badRequestException = "BadRequestException"
        case conflictException = "ConflictException"
        case internalFailureException = "InternalFailureException"
        case internalServerException = "InternalServerException"
        case notFoundException = "NotFoundException"
        case requestEntityTooLargeException = "RequestEntityTooLargeException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case tooManyRequestsException = "TooManyRequestsException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Synthetics
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You don't have permission to perform this operation on this resource.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The request was not valid.
    public static var badRequestException: Self { .init(.badRequestException) }
    /// A conflicting operation is already in progress.
    public static var conflictException: Self { .init(.conflictException) }
    /// An internal failure occurred. Try the operation again.
    public static var internalFailureException: Self { .init(.internalFailureException) }
    /// An unknown internal error occurred.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The specified resource was not found.
    public static var notFoundException: Self { .init(.notFoundException) }
    /// One of the input resources is larger than is allowed.
    public static var requestEntityTooLargeException: Self { .init(.requestEntityTooLargeException) }
    /// One of the specified resources was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The request exceeded a service quota value.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// There were too many simultaneous requests. Try the operation again.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// A parameter could not be validated.
    public static var validationException: Self { .init(.validationException) }
}

extension SyntheticsErrorType: Equatable {
    public static func == (lhs: SyntheticsErrorType, rhs: SyntheticsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension SyntheticsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
